#  登录页面类
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By

#数据
driver = webdriver.Chrome()
driver.maximize_window()
driver.get('http://192.168.1.83/crm')
username = 'zhangsan'
password = '123456'

#元素定位器
username_locator = (By.NAME,'name')      #登录账号
password_locator = (By.NAME, 'password')  #登录密码
btn_locator = (By.NAME,'submit')        #点击登录按钮

# 操作方法
# 输入用户名
username_element = driver.find_element(*username_locator).send_keys(username)
 # 输入用户名
password_element = driver.find_element(*password_locator).send_keys(password)
sleep(2)
 # 点击登录
btn_element = driver.find_element(*btn_locator).click()
sleep(5)










